package com.wingy.myautocompletetextview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.MultiAutoCompleteTextView;

public class myAutoCompleteTextViewActivity extends AppCompatActivity {

    private static final String[] autoStr = new String[]{"abc", "abcd", "abcde"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, autoStr);

        AutoCompleteTextView myAutoCompleteTextView = (AutoCompleteTextView)findViewById(R.id.myAutoCompleteTextView);

        myAutoCompleteTextView.setAdapter(arrayAdapter);

        MultiAutoCompleteTextView myMultiAutoCompleteTextView = (MultiAutoCompleteTextView) findViewById(R.id.myMultiAutoCompleteTextView);

        myMultiAutoCompleteTextView.setAdapter(arrayAdapter);

        myMultiAutoCompleteTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());

    }
}
